Change in openvpn[master]: mudp: fix handling of multiple UDP event flags
A message that is not in the archive (sent off-list or not yet received): gerrit.1762271747000.I51e0ffd54fef817894f35f51c7c57c8167cfbd6c@...2715...
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1347?usp=email
to review the following change.
Change subject: mudp: fix handling of multiple UDP event flags
......................................................................
mudp: fix handling of multiple UDP event flags
The handler previously used an 'else-if' chain to process only the first matching UDP event flag, and then overwrote 'm->multi_io->udp_flags' with a fixed value (e.g. 'ES_ERROR'). This caused remaining event bits to be ignored if multiple flags (such as SOCKET_READ or SOCKET_WRITE) were set simultaneously.
This patch changes the logic to test each flag independently and clear only the bits that were actually handled.
---
M src/openvpn/mudp.c
1 file changed, 9 insertions(+), 1 deletion(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/47/1347/1
src/openvpn/mudp.c +9 -1
@@ -342,6 +342,7 @@const unsigned int mpp_flags = m->top.c2.fast_io ? (MPP_CONDITIONAL_PRE_SELECT |MPP_CLOSE_ON_SIGNAL ) : (MPP_PRE_SELECT |MPP_CLOSE_ON_SIGNAL ); +unsigned int processed_flags =0 ;#ifdef MULTI_DEBUG_EVENT_LOOP char buf[16 ];
@@ -374,6 +375,7 @@ {ASSERT (management);management_io (management); + processed_flags |= (MANAGEMENT_READ |MANAGEMENT_WRITE ); }#endif
@@ -381,11 +383,13 @@if (status &SOCKET_WRITE ) {multi_process_outgoing_link (m, mpp_flags); + processed_flags |=SOCKET_WRITE ; }/* TUN device ready to accept write */ else if (status &TUN_WRITE ) {multi_process_outgoing_tun (m, mpp_flags); + processed_flags |=TUN_WRITE ; }/* Incoming data on UDP port */ else if (status &SOCKET_READ )
@@ -395,6 +399,7 @@ {multi_process_incoming_link (m,NULL , mpp_flags, sock); } + processed_flags |=SOCKET_READ ; }/* Incoming data on TUN device */ else if (status &TUN_READ )
@@ -404,12 +409,14 @@ {multi_process_incoming_tun (m, mpp_flags); } + processed_flags |=TUN_READ ; }#ifdef ENABLE_ASYNC_PUSH /* INOTIFY callback */ else if (status & FILE_CLOSED) {multi_process_file_closed (m, mpp_flags); + processed_flags |=FILE_CLOSED ; }#endif #if defined(ENABLE_DCO )
@@ -423,10 +430,11 @@ ret = multi_process_incoming_dco(m); } } + processed_flags |=DCO_READ ; }#endif - m->multi_io->udp_flags =ES_ERROR ; + m->multi_io->udp_flags &= ~processed_flags; }/*
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1347?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I51e0ffd54fef817894f35f51c7c57c8167cfbd6c
Gerrit-Change-Number: 1347
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
its_Giaan has abandoned this change. ( http://gerrit.openvpn.net/c/openvpn/+/1347?usp=email )
Change subject: mudp: fix handling of multiple UDP event flags
......................................................................
Abandoned
Found more worms in this path so i'm reworking this
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1347?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: abandon
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I51e0ffd54fef817894f35f51c7c57c8167cfbd6c
Gerrit-Change-Number: 1347
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>